<div class="admin list order">

    <table>
        <tr>
            <th>
	            <select id="select-status">
		            <option value="<?php echo $this->createUrl('/admin/goods/order/list/', array()); ?>">Все</option>
	            <?php foreach(Order::model()->statuses as $status => $title): ?>
		            <option <?php echo $status == $selectedStatus ? ' selected': ''; ?> value="<?php echo $this->createUrl('/admin/goods/order/list/', array('status' => $status)); ?>"><?php echo $title; ?></option>
	            <?php endforeach; ?>
	            </select>
            </th>
            <th>Заказ</th>
            <th></th>
        </tr>

        <?php if($oRowset): ?>
            <?php $index = 0; foreach($oRowset as $oRow): $index++; ?>
            <tr class="row<?php echo $index % 2 == 1 ? ' grey' : ''; ?>">
                <td><?php echo Order::model()->statuses[$oRow->status]; ?></td>
                <td>
	                <?php if($oRow->date): ?><p><?php echo $oRow->date; ?></p><?php endif; ?>
	                <?php if($oRow->name): ?><p><?php echo $oRow->name; ?></p><?php endif; ?>
	                <?php if($oRow->phone): ?><p><?php echo $oRow->phone; ?></p><?php endif; ?>
	                <?php if($oRow->email): ?><p><?php echo $oRow->email; ?></p><?php endif; ?>
	                <?php if($oRow->address): ?><p><?php echo $oRow->address; ?></p><?php endif; ?>
	                <?php if($oRow->comment): ?><p><?php echo $oRow->comment; ?></p><?php endif; ?>
                </td>
                <td class="action">
                    <a href="<?php echo $this->createUrl('/admin/goods/order/editor/', array('id' => $oRow->id)); ?>">Редактировать</a>
                    <a onclick="return confirm('Удалить заказ?');" href="<?php echo $this->createUrl('/admin/goods/order/delete/', array('id' => $oRow->id)); ?>">Удалить</a>
                </td>
            </tr>
            <?php endforeach; ?>

        <?php endif; ?>
    </table>

    <?php
    $this->widget('CLinkPager', array(
        'pages' => $this->oPager,
        'maxButtonCount'=>5,
        'header'=>'',
        'htmlOptions'=>array('class'=>'pager'),
    )); ?>
</div>